package edu.kit.ksri.db.mturk.var;

import java.util.Calendar;

import com.amazonaws.mturk.requester.HIT;
import com.amazonaws.mturk.requester.QualificationRequirement;
import com.amazonaws.mturk.requester.QualificationTypeStatus;

import edu.kit.ksri.db.mturk.plugins.correctness.AbstractQualityControlImplementation;
import edu.kit.ksri.db.mturk.plugins.correctness.WMVBinomial;
import edu.kit.ksri.db.mturk.plugins.correctness.answers.AbstractAssignmentAnswer;
import edu.kit.ksri.db.mturk.plugins.correctness.answers.BasicAssignmentAnswer;

/**
 * Copyright (c) 2010-2011 Karlsruhe Institute of Technology (KIT), Germany
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 * 
 * --------------------------------------------------------------------------
 * 
 * Software: CSP/WMV tool for dynamic quality management of microtasks
 * http://www.ksri.kit.edu/Upload/Users/PeopleClouds/HCOMP2011_An_extendable_toolkit_for_managing_quality_of_human-based_eServices.pdf
 * 
 * Organization: Karlsruhe Institute of Technology (KIT), Germany
 * http://www.kit.edu
 * 
 * Project: PeopleClouds project of the Karlsruhe Service Research Institute(KSRI)
 * http://www.ksri.kit.edu/Default.aspx?PageId=818
 * 
 * Contributing authors: David Bermbach, Sandra Rath, Pascal Wichmann, Robert Kern
 */
public abstract class Scenario {

	/**
	 * A general description of HITs of this type.
	 * 
	 * A description includes detailed information about the kind of task the
	 * HIT contains. On the Mechanical Turk web site, the HIT description
	 * appears in the expanded view of search results, and in the HIT and
	 * assignment screens. A good description gives the user enough information
	 * to evaluate the HIT before accepting it.
	 * 
	 * Though the description is displayed while a Worker completes the HIT, the
	 * question data (submitted to CreateHIT) should include the complete
	 * instructions for completing the HIT. The Worker may not know to look for
	 * instructions in the HIT's description.
	 * 
	 * The description must be less than 2,000 characters in length.
	 */
	protected String hitDescription;

	/**
	 * The title for HITs of this type.
	 * 
	 * A title should be short and descriptive about the kind of task the HIT
	 * contains. On the Mechanical Turk web site, the HIT title appears in
	 * search results, and everywhere the HIT is mentioned.
	 */
	protected String hitTitle;

	/**
	 * One or more words or phrases that describe a HIT of this type, separated
	 * by commas. Searches for words similar to a HIT's keywords are more likely
	 * to return the HIT in the search results.
	 * 
	 * The complete string of keywords, including commas and spaces, must be
	 * fewer than 1,000 characters.
	 */
	protected String hitKeywords;

	/**
	 * The name of the qualification
	 */
	protected String qualificationName;

	/**
	 * the qualification which shall be used for distinguishing between the
	 * pools. Also put into input properties file!
	 */
	protected String qualificationTypeID;

	/**
	 * The HIT Type ID used for publishing new HITs
	 */
	protected String hitTypeID;

	/**
	 * The class which shall be used to assert correctness of results, i.e.
	 * {@link WMVBinomial}.class etc.
	 */
	protected Class<? extends AbstractQualityControlImplementation> correctnessPluginClass;


	/**
	 * which class shall be used to compare results
	 */
	protected Class<? extends AbstractAssignmentAnswer> answerComparisonClass;

	/**
	 * invocation parameters when creating a new instance of
	 * answerComparisonClass. The raw answer is always provided as the first
	 * parameter and need not be contained within this parameter list.
	 */
	protected Object[] answerComparisonClassParameters;
	
	/**
	 * The prefix of the scenario. First letter is usually UpperCase
	 */
	protected String prefix;

	/**
	 * The amount of money the Requester will pay a user for successfully
	 * completing a HIT of this type
	 */
	protected Double hitReward;
	
	/**
	 * An amount of time after an assignment for a HIT of this type has been
	 * submitted, after which the assignment will be considered "approved"
	 * automatically unless the Requester explicitly rejects it.
	 * 
	 * If not specified, the auto-approval delay is set to the maximum value of
	 * 30 days (2592000 seconds). In most cases, the Requester will be able to
	 * retrieve and approve answers directly before the auto-approval delay
	 * elapses. The maximum value assures that the Worker will get paid even if
	 * the Requester is unavailable.
	 * 
	 * A Requester may wish to specify a shorter auto-approval delay if the
	 * Workers are trusted (such as by having been vetted with high
	 * Qualification requirements) and to assure Workers that they will be paid
	 * in a timely manner.
	 * 
	 * There is no way to automatically reject results. To reject results, the
	 * Requester must explicitly call the RejectAssignment method.
	 * 
	 * Once an assignment has been approved, it cannot be rejected, and payment
	 * cannot be reversed.
	 * 
	 * AutoApprovalDelayInSeconds must be between 0 (immediate) and 2592000 (30
	 * days).
	 */
	protected Long hitAutoApprovalDelayInSeconds;
	
	/**
	 * The amount of time a user has to complete a HIT of this type after
	 * accepting it.
	 * 
	 * If a user does not complete their assignment in the specified duration,
	 * the assignment is considered abandoned. If the HIT is still active (its
	 * lifetime has not elapsed), the assignment becomes available for other
	 * users to find and accept.
	 * 
	 * AssignmentDurationInSeconds must be between 30 (30 seconds) and 31536000
	 * (365 days)
	 */
	protected Long hitAssignmentDurationInSeconds;
	
	/**
	 * A condition that a Worker's Qualifications must meet before the Worker is
	 * allowed to accept and complete a HIT of this type.
	 * 
	 * The condition specifies that the Worker must have a Qualification of a
	 * particular Qualification type, and that its value must compare to the
	 * requirement's value in the specified way: equal to, not equal to, less
	 * than, less than or equal to, greater than or equal to, or greater than.
	 * 
	 * A HIT may have between zero and ten (10) Qualification requirements. All
	 * requirements must be met by a Worker's Qualifications for the Worker to
	 * accept the HIT.
	 * 
	 * All of a HIT's Qualification requirements must be based on Qualification
	 * types with an "active" status. If any requirement is based on a
	 * Qualification type with an "inactive" status, the call to CreateHIT will
	 * fail.
	 * 
	 * In case no Qualification Test should be applied, then set this field null.
	 */
	protected QualificationRequirement[] hitQualRequirements;
	
	/**
	 * The hitCreationType of the scenario. Either "Batch" or "Manually"
	 */
	protected String hitCreationType;

	/**
	 * The keywords for the qualification
	 */
	protected String qualificationKeywords;

	/**
	 * The description for the qualification
	 */
	protected String qualificationDescription;

	/**
	 * The type status of the qualification. Either
	 * QualificationTypeStatus.Active or QualificationTypeStatus.Inactive.
	 * 
	 * The initial status of the Qualification type. A Qualification type's status
	 * determines if users can apply to receive a Qualification of this type,
	 * and if HITs can be created with requirements based on this type.
	 * 
	 * If a Qualification type is Active, a user can take a Qualification test to
	 * receive the Qualification, and HITs can include requirements based on the
	 * type. If the QualificationTypeStatus is Inactive, users may not apply for
	 * the Qualification, and newly created HITs may not use the type for their
	 * requirements.
	 */
	protected QualificationTypeStatus qualificationTypeStatus;

	/**
	 * The time in seconds which restricts how often a worker can take a test
	 */
	protected long qualificationRetryDelayInSeconds;

	/**
	 * The time allotted for taking the qualification test, i.e. how long a 
	 * worker has to complete the qualification test (should not be too low)
	 */
	protected long qualificationTestDurationInSeconds;

	/**
	 * If true, requests for the Qualification type will be granted immediately, 
	 * without prompting the Worker with a Qualification test.
	 * A Qualification type cannot have both a Test and an AutoGranted value of true. 
	 */
	protected boolean qualificationAutoGranted;

	/**
	 * The Qualification value to use for automatically granted 
	 * Qualifications, if AutoGranted is true.
	 * If AutoGrantedValue is not specified and AutoGranted is true, 
	 * Qualifications will be granted automatically with a value of "1". 
	 */
	protected Integer qualificationAutoGrantedValue;
	
	/**
	 * The time in seconds until {@link HIT}s are no longer available on MTurk.
	 */
	protected Long timeUntilHITExpiration;
	
	/**
	 * All raw results that have to be inspected according to the CSP-1 for the
	 * respective worker, are validated by passing redundant results to other
	 * workers in order to be able to come to a group decision which meets a
	 * minimum inspection quality level phi_min.
	 */
	protected double minimumInspectionQualityLevel;

	/**
	 * A task gets escalated to the requester if the overall probability y for
	 * getting a result set Ry is lower than the escalation limit epsilon_max
	 */
	protected double escalationLimit;
	
	/**
	 * The sampling plan starts with 100% inspection. If i consecutive units are
	 * found free of defects, only a fraction f of the units are inspected. If a
	 * unit is found to be defective, the model returns to 100% inspection and
	 * the process starts from the beginning.
	 */
	protected int i;

	/**
	 * The sampling plan starts with 100% inspection. If i consecutive units are
	 * found free of defects, only a fraction f of the units are inspected. If a
	 * unit is found to be defective, the model returns to 100% inspection and
	 * the process starts from the beginning.
	 */
	protected double f;

	/**
	 * For nominal scenarios, the minimum number of categories determines the number
	 * of options a worker has when choosing a result. For a binary task the number
	 * would be two. For an OCR scenario it would be the typical number of different
	 * spellings for the given word that the workers are typing in (about 2 to 5)
	 * rather than the theoretical number of different spellings.    
	 */
	protected int minimumNumberOfCategories;

	/** the deadline when all tasks shall be finished */
	protected Calendar deadline;

	/**
	 * the estimated number of milliseconds which a single assignment will take
	 * to complete.
	 */
	protected int estimatedTaskDuration;
	
	/**
	 * mode configuration for the class {@link BasicAssignmentAnswer} - if it is
	 * used
	 */
	protected int basicAssignmentAnswerMode;
	
	/**
	 * defines whether the connection handlers will use MTurk simulation classes
	 * or a simulation system. Possible values are PERFSIM, CORRSIM, CORRSIMINPUT and LIVE.
	 * Any other value defaults to LIVE.
	 */
	protected ConnectionMode connectionMode;
	
	/**
	 * defines whether the input assignments for the correction simulation should be read randomly or in order. 
	 * Possible values are RANDOM and ORDER.
	 */
	protected CorrSimMode corrSimModeAssignment;
	
	/**
	 * defines whether the input hits for the correction simulation should be read randomly or in order. 
	 * Possible values are RANDOM and ORDER.
	 */
	protected CorrSimMode corrSimModeHIT;
	
	/**
	 * defines whether the input hits for the correction simulation should be read randomly or in order. 
	 * Possible values are RANDOM and ORDER.
	 */
	protected SimMode simModeHIT;
	
	/**
	 * How many HITs should be created for correctness simulation
	 */
	protected int simulationHitCount;
	
	/**
	 * The input type for the task, e.g. a single URL, one IMG, several IMGs or TEXT
	 */
	protected String taskInputType;

	/**
	 * The height for the image of the task (in case there is a picture)
	 */
	protected String taskPictureHeight;
	
	/**
	 * After that many seconds the summary.html automatically refreshes in the browser
	 */
	protected int refreshDelay;
	
	/**
	 * Returns the refresh Delay
	 * 
	 * @return String refreshDelay
	 */
	public int getRefreshDelay(){
		return refreshDelay;
	}
	
	
	/**
	 * Returns the height of the image of the task
	 * 
	 * @return String taskPictureHeight
	 */
	public String getTaskPictureHeight(){
		return taskPictureHeight;
	}
	
	/**
	 * Returns the description of the hit
	 * 
	 * @return String description
	 */
	public String getHitDescription() {
		return hitDescription;
	}
	
	/**
	 * Returns the input type for the task, e.g. a single URL, several URLs or plain text
	 * 
	 * @return String taskInputType
	 */
	public String getTaskInputType(){
		return taskInputType;
	}
	
	/**
	 * Returns the answer comparison class
	 * 
	 * @return Class <? extends AbstractAssignmentAnswer> answerComparisonClass
	 */
	public Class <? extends AbstractAssignmentAnswer> getAnswerComparisonClass() {
		return answerComparisonClass;
	}
	
	/**
	 * Returns the parameters of the answer comparison class
	 * 
	 * @return Object[] answerComparisonClassParameters
	 */
	public Object[] getAnswerComparisonClassParameters() {
		return answerComparisonClassParameters;
	}

	/**
	 * Returns the title of the hit
	 * 
	 * @return String title
	 */
	public String getHitTitle() {
		return hitTitle;
	}

	/**
	 * Returns the keywords of the hit
	 * 
	 * @return String keywords
	 */
	public String getHitKeywords() {
		return hitKeywords;
	}

	/**
	 * Returns the qualification name of a qualification
	 * 
	 * @return String qualificationName
	 */
	public String getQualificationName() {
		return qualificationName;
	}
	
	/**
	 * Returns the keywords of a qualification
	 * 
	 * @return String qualificationKeywords
	 */
	public String getQualificationKeywords() {
		return qualificationKeywords;
	}
	
	/**
	 * Returns the description of a qualification
	 * 
	 * @return String qualificationDescription
	 */
	public String getQualificationDescription() {
		return qualificationDescription;
	}
	
	/**
	 * Returns the type status of a qualification
	 * 
	 * @return String qualificationTypeStatus
	 */
	public QualificationTypeStatus getQualificationTypeStatus() {
		return qualificationTypeStatus;
	}

	/**
	 * Returns the retry delay of the qualification
	 * 
	 * @return String qualificationRetryDelayInSeconds
	 */
	public long getQualificationRetryDelayInSeconds() {
		return qualificationRetryDelayInSeconds;
	}

	/**
	 * Returns the test duration of the qualification
	 * 
	 * @return String qualificationTestDurationInSeconds
	 */
	public long getQualificationTestDurationInSeconds() {
		return qualificationTestDurationInSeconds;
	}

	/**
	 * Returns if the qualification is auto granted
	 * 
	 * @return String qualificationAutoGranted
	 */
	public boolean isQualificationAutoGranted() {
		return qualificationAutoGranted;
	}

	/**
	 * Returns the auto granted value of the qualification
	 * 
	 * @return String qualificationAutoGrantedValue
	 */
	public Integer getQualificationAutoGrantedValue() {
		return qualificationAutoGrantedValue;
	}

	/**
	 * Returns the qualification type ID of a scenario
	 * 
	 * @return String qualificationTypeID
	 */
	public String getQualificationTypeID() {
		return qualificationTypeID;
	}
	
	/**
	 * Returns the reward of a hit
	 * 
	 * @return String hitReward
	 */
	public Double getHitReward() {
		return hitReward;
	}

	/**
	 * Returns the auto approval delay of a hit
	 * 
	 * @return String hitAutoApprovalDelayInSeconds
	 */
	public Long getHitAutoApprovalDelayInSeconds() {
		return hitAutoApprovalDelayInSeconds;
	}

	/**
	 * Returns the assignment duration of a hit
	 * 
	 * @return String hitAssignmentDurationInSeconds
	 */
	public Long getHitAssignmentDurationInSeconds() {
		return hitAssignmentDurationInSeconds;
	}

	/**
	 * Returns the qualification requirements of a hit
	 * 
	 * @return String hitQualRequirements
	 */
	public QualificationRequirement[] getHitQualRequirements() {
		return hitQualRequirements;
	}

	/**
	 * Returns the creation type of a hit
	 * 
	 * @return String hitCreationType
	 */
	public String getHitCreationType() {
		return hitCreationType;
	}

	/**
	 * Returns the hit type ID
	 * 
	 * @return String hitTypeID
	 */
	public String getHitTypeID() {
		return hitTypeID;
	}

	/**
	 * Returns the correctness plugin class
	 * 
	 * @return String correctnessPluginClass
	 */
	public Class<? extends AbstractQualityControlImplementation> getCorrectnessPluginClass() {
		return correctnessPluginClass;
	}

	/**
	 * Returns the prefix of the scenario
	 * 
	 * @return String prefix
	 */
	public String getPrefix() {
		return prefix;
	}

	/**
	 * Returns the HIT creation type of the scenario
	 * 
	 * @return String hitCreationType
	 */
	public String getHITCreationType() {
		return hitCreationType;
	}
	
	/**
	 * Returns the time until the HIT expires
	 * 
	 * @return Long timeUntilHITExpiration
	 */
	public Long getTimeUntilHitExpiration() {
		return timeUntilHITExpiration;
	}

	/**
	 * Returns the minimum inspection quality level
	 * 
	 * @return double minimumInspectionQualityLevel
	 */
	public double getMinimumInspectionQualityLevel() {
		return minimumInspectionQualityLevel;
	}

	/**
	 * Returns the escalation limit
	 * 
	 * @return double escalationLimit
	 */
	public double getEscalationLimit() {
		return escalationLimit;
	}

	/**
	 * Returns i
	 * 
	 * @return int i
	 */
	public int getI() {
		return i;
	}

	/**
	 * Returns f
	 * 
	 * @return double f
	 */
	public double getF() {
		return f;
	}

	/**
	 * Returns the minimum number of categories for the scenario
	 * 
	 * @return double f
	 */
	public int getMinimumNumberOfCategories() {
		return minimumNumberOfCategories;
	}

	/**
	 * Returns the deadline
	 * 
	 * @return Calendar deadline
	 */
	public Calendar getDeadline() {
		return deadline;
	}

	/**
	 * Returns the estimated task duration
	 * 
	 * @return int estimatedTaskDuration
	 */
	public int getEstimatedTaskDuration() {
		return estimatedTaskDuration;
	}

	/**
	 * Returns the basic assignment answer mode
	 * 
	 * @return int basicAssignmentAnswerMode
	 */
	public int getBasicAssignmentAnswerMode() {
		return basicAssignmentAnswerMode;
	}

	/**
	 * Returns the connection mode
	 * 
	 * @return String connectionMode
	 */
	public ConnectionMode getConnectionMode() {
		return connectionMode;
	}
	
	/**
	 * Returns the corrsimmodeassignment
	 * 
	 * @return String corrSimMode
	 */
	public CorrSimMode getCorrSimModeAssignment() {
		return corrSimModeAssignment;
	}
	
	/**
	 * Returns the simMode
	 * 
	 * @return String SimMode
	 */
	public SimMode getSimModeHIT() {
		return simModeHIT;
	}
	
	
	/**
	 * Returns the corrsimmode
	 * 
	 * @return String corrSimMode
	 */
	public CorrSimMode getCorrSimModeHIT() {
		return corrSimModeHIT;
	}
	
	/**
	 * Returns the count of the simulation HITs
	 * 
	 * @return int simulationHitCount
	 */
	public int getSimulationHitCount(){
		return simulationHitCount;
	}
	
	public String getParameters(){
		String s = "";
		
		if(connectionMode.equals(ConnectionMode.CORRSIM)){
			s = "Settings are: " + StaticInformation.scenario.getPrefix() + ", " + 
			StaticInformation.scenario.getConnectionMode() + " Mode, CorrSimModeAssignment: " + 
			StaticInformation.scenario.getCorrSimModeAssignment() + ", CorrSimModeHIT: " + 
			StaticInformation.scenario.getCorrSimModeHIT() + ", SimulationHitCount: " + 
			StaticInformation.scenario.getSimulationHitCount() + ", MinimumInspectionQualityLevel: " + 
			StaticInformation.scenario.getMinimumInspectionQualityLevel() + ", EscalationLimit: " + 
			StaticInformation.scenario.getEscalationLimit() + ", i: " + 
			StaticInformation.scenario.getI() + ", f: " + 
			StaticInformation.scenario.getF() + ", CorrectnessPluginClass: " + 
			StaticInformation.scenario.getCorrectnessPluginClass().getSimpleName() + ", TimeUntilHitExpiration: " +
			StaticInformation.scenario.getTimeUntilHitExpiration() + ", Deadline: " +
			StaticInformation.scenario.getDeadline().getTime() + ", EstimatedTaskDuration: " +
			StaticInformation.scenario.getEstimatedTaskDuration() + ", HitCreationType: " +
			StaticInformation.scenario.getHitCreationType() + ", HitReward: " +
			StaticInformation.scenario.getHitReward();
			
			if(StaticInformation.scenario.getHitCreationType().equals("Batch")){
				s = s + "\nHitCreationType is Batch. Parameters in " + StaticInformation.scenario.getPrefix().toLowerCase() + ".properties might differ.";
			}

		}
		else if(connectionMode.equals(ConnectionMode.CORRSIMINPUT)){
			s = "Settings are: " + StaticInformation.scenario.getPrefix() + ", " + 
			StaticInformation.scenario.getConnectionMode() + " Mode, SimulationHitCount: " + 
			StaticInformation.scenario.getSimulationHitCount() + ", MinimumInspectionQualityLevel: " +
			StaticInformation.scenario.getMinimumInspectionQualityLevel() + ", EscalationLimit: " + 
			StaticInformation.scenario.getEscalationLimit() + ", i: " + 
			StaticInformation.scenario.getI() + ", f: " + 
			StaticInformation.scenario.getF() + ", Minimum number of categories: " + 
			StaticInformation.scenario.getMinimumNumberOfCategories() + ", CorrectnessPluginClass: " + 
			StaticInformation.scenario.getCorrectnessPluginClass().getSimpleName() + ", TimeUntilHitExpiration: " +
			StaticInformation.scenario.getTimeUntilHitExpiration() + ", Deadline: " +
			StaticInformation.scenario.getDeadline().getTime() + ", EstimatedTaskDuration: " +
			StaticInformation.scenario.getEstimatedTaskDuration() + ", HitCreationType: " +
			StaticInformation.scenario.getHitCreationType() + ", HitReward: " +
			StaticInformation.scenario.getHitReward();
		}
		else if(connectionMode.equals(ConnectionMode.LIVE)){
			s = "Settings are: " + StaticInformation.scenario.getPrefix() + ", " + 
			StaticInformation.scenario.getConnectionMode() + " Mode, MinimumInspectionQualityLevel: " + 
			StaticInformation.scenario.getMinimumInspectionQualityLevel() + ", EscalationLimit: " + 
			StaticInformation.scenario.getEscalationLimit() + ", i: " + 
			StaticInformation.scenario.getI() + ", f: " + 
			StaticInformation.scenario.getF() + ", Minimum number of categories: " + 
			StaticInformation.scenario.getMinimumNumberOfCategories() + ", CorrectnessPluginClass: " + 
			StaticInformation.scenario.getCorrectnessPluginClass().getSimpleName() + ", TimeUntilHitExpiration: " +
			StaticInformation.scenario.getTimeUntilHitExpiration() + ", Deadline: " +
			StaticInformation.scenario.getDeadline().getTime() + ", EstimatedTaskDuration: " +
			StaticInformation.scenario.getEstimatedTaskDuration() + ", HitCreationType: " +
			StaticInformation.scenario.getHitCreationType() + ", HitReward: " +
			StaticInformation.scenario.getHitReward();
		}
		else if(connectionMode.equals(ConnectionMode.PERFSIM)){
			s = "Settings are: " + StaticInformation.scenario.getPrefix() + ", " + 
			StaticInformation.scenario.getConnectionMode() + " Mode, MinimumInspectionQualityLevel: " + 
			StaticInformation.scenario.getMinimumInspectionQualityLevel() + ", EscalationLimit: " + 
			StaticInformation.scenario.getEscalationLimit() + ", i: " + 
			StaticInformation.scenario.getI() + ", f: " + 
			StaticInformation.scenario.getF() + ", Minimum number of categories: " + 
			StaticInformation.scenario.getMinimumNumberOfCategories() + ", CorrectnessPluginClass: " + 
			StaticInformation.scenario.getCorrectnessPluginClass().getSimpleName() + ", TimeUntilHitExpiration: " +
			StaticInformation.scenario.getTimeUntilHitExpiration() + ", Deadline: " +
			StaticInformation.scenario.getDeadline() + ", EstimatedTaskDuration: " +
			StaticInformation.scenario.getEstimatedTaskDuration() + ", HitCreationType: " +
			StaticInformation.scenario.getHitCreationType() + ", HitReward: " +
			StaticInformation.scenario.getHitReward();
		}
		else if(connectionMode.equals(ConnectionMode.SIM)){
			s = "Settings are: " + StaticInformation.scenario.getPrefix() + ", " + 
			StaticInformation.scenario.getConnectionMode() + " Mode, MinimumInspectionQualityLevel: " + 
			StaticInformation.scenario.getMinimumInspectionQualityLevel() + ", EscalationLimit: " + 
			StaticInformation.scenario.getEscalationLimit() + ", i: " + 
			StaticInformation.scenario.getI() + ", f: " + 
			StaticInformation.scenario.getF() + ", Minimum number of categories: " + 
			StaticInformation.scenario.getMinimumNumberOfCategories() + ", CorrectnessPluginClass: " + 
			StaticInformation.scenario.getCorrectnessPluginClass().getSimpleName() + ", TimeUntilHitExpiration: " +
			StaticInformation.scenario.getTimeUntilHitExpiration() + ", Deadline: " +
			StaticInformation.scenario.getDeadline() + ", EstimatedTaskDuration: " +
			StaticInformation.scenario.getEstimatedTaskDuration() + ", HitCreationType: " +
			StaticInformation.scenario.getHitCreationType() + ", HitReward: " +
			StaticInformation.scenario.getHitReward();
		}
		
		return s;
	}
	
}
